import client.rpc.RpcImporter;
import com.sun.org.apache.xpath.internal.SourceTree;
import product.service.impl.MyServiceImpl;
import product.service.inter.MyService;
import product.service.rpc.RpcExporter;

import java.net.InetSocketAddress;

/**
 * Created by ydw on 2017/6/27.
 */
public class RpcTest {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    RpcExporter.exporter("localhost",8088);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }).start();
        RpcImporter<MyService> importer=new RpcImporter<>();
        MyService service = importer.importer(MyServiceImpl.class, new InetSocketAddress("localhost", 8088));
        System.out.println(service.say("Lilei"));

    }
}
